<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<input type="hidden" id="pageNumHid" value="${pageInfo.pageNum}" />
<input type="hidden" id="pageSizeHid" value="${pageInfo.pageSize}" />
<input type="hidden" id="totalHid" value="${pageInfo.totalNum}" />

<table id="prodTable" style="height:auto;overflow: scroll;">
	<thead>
		<tr>
			<th data-options="field:'itemId'" width="180">用户ID</th>
			<th data-options="field:'productId'" width="200">产品ID</th>
			<th data-options="field:'listPrice',align:'right'" width="80">标价</th>
			<th data-options="field:'unitCost',align:'right'" width="80">单价</th>
			<th data-options="field:'attr1'" width="150">属性</th>
			<th data-options="field:'opts',align:'center'" width="150">操作栏</th>
		</tr>
	</thead>
	<tbody>
		<s:iterator value="pageInfo.resultList" var="p">
			<tr>
				<td><s:property value="itemId" /></td>
				<td><s:property value="productId" /></td>
				<td><s:property value="listPrice" /></td>
				<td><s:property value="unitCost" /></td>
				<td><s:property value="attr1" /></td>
				<td>
					<a href="#" onclick="alert('test'); return false;">查看</a>
					<a href="#">删除</a>
				</td>
			</tr>
		</s:iterator>
	</tbody>
</table>
<div id="tb" style="padding:5px;height:auto;">
	<div>
		<table>
			<tr>
				<td width="100">Date From: </td>
				<td><input class="easyui-datebox" style="width:200px" /></td>
				<td>To: </td>
				<td><input class="easyui-datebox" style="width:200px" /></td>
				<td>Language:</td>
				<td>
					<select class="easyui-combobox" panelHeight="auto" style="width:100px">
						<option value="java">Java</option>
						<option value="c">C</option>
						<option value="basic">Basic</option>
						<option value="perl">Perl</option>
						<option value="python">Python</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="6"><input type="button" value="搜索" /></td>
			</tr>
		</table>
	</div>
</div>
<script type="text/javascript">
$(function() {
	var pageNum = $("#pageNumHid").val();
	var pageSize = $("#pageSizeHid").val();
	var total = $("#totalHid").val();

	var dg = $("#prodTable").datagrid({
		"singleSelect": true,
		"autoRowHeight": false,
		"pagination": true,
		"pageNumber": pageNum,
		"pageSize": pageSize,
		"pageList":[5,10,15,20],
		"toolbar": '#tb'
	});
	var pager = dg.datagrid("getPager");
	pager.pagination({
		"total": total,
		onSelectPage:function(pageNum, pageSize){
		}
	});	
});
</script>